<?php
/**
 * Created by PhpStorm.
 * User: yf
 * Date: 2017/6/30
 * Time: 下午11:55
 */

namespace App;


use Core\AbstractInterface\AbstractRouter;
use Core\Http\Response;
use FastRoute\RouteCollector;

class Router extends AbstractRouter
{

    function addRouter(RouteCollector $routeCollector)
    {
        $routeCollector->addRoute(['GET'],"/Public/{type}/{name}/{ext}",function ($type,$name,$ext){
            $res = parent::response();
            $res->write(file_get_contents(ROOT."/Public/".$type."/".$name.".".$ext));
            $res->end();
        });
    }
}